/*
 * DM9K Ethernet
 */ 
#ifndef __DM9K_LWIP_H 
#define __DM9K_LWIP_H 

#include "raw_api.h"

#define DM9K_ID		0x90000A46

/* although the registers are 16 bit, they are 32-bit aligned.
 */

#define DM9K_NCR             0x00
#define DM9K_NSR             0x01
#define DM9K_TCR             0x02
#define DM9K_TSR1            0x03
#define DM9K_TSR2            0x04
#define DM9K_RCR             0x05
#define DM9K_RSR             0x06
#define DM9K_ROCR            0x07
#define DM9K_BPTR            0x08
#define DM9K_FCTR            0x09
#define DM9K_FCR             0x0A
#define DM9K_EPCR            0x0B
#define DM9K_EPAR            0x0C
#define DM9K_EPDRL           0x0D
#define DM9K_EPDRH           0x0E
#define DM9K_WCR             0x0F

#define DM9K_PAR             0x10
#define DM9K_MAR             0x16

#define DM9K_GPCR			   0x1e
#define DM9K_GPR			   0x1f
#define DM9K_TRPAL           0x22
#define DM9K_TRPAH           0x23
#define DM9K_RWPAL           0x24
#define DM9K_RWPAH           0x25

#define DM9K_VIDL            0x28
#define DM9K_VIDH            0x29
#define DM9K_PIDL            0x2A
#define DM9K_PIDH            0x2B

#define DM9K_CHIPR           0x2C
#define DM9K_SMCR            0x2F

#define DM9K_MRCMDX          0xF0
#define DM9K_MRCMD           0xF2
#define DM9K_MRRL            0xF4
#define DM9K_MRRH            0xF5
#define DM9K_MWCMDX          0xF6
#define DM9K_MWCMD           0xF8
#define DM9K_MWRL            0xFA
#define DM9K_MWRH            0xFB
#define DM9K_TXPLL           0xFC
#define DM9K_TXPLH           0xFD
#define DM9K_ISR             0xFE
#define DM9K_IMR             0xFF



void DM9K_init(void);
void DM9K_sendPcket(RAW_U8 *datas, RAW_U32 length);
void DM9K_PrintReg(void);
void DM9K_Test(void);
RAW_U32 DM9K_receivepacket(RAW_U8 *datas);
 
#endif /* _DM9KX_H_ */
